package com.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "对外释放本项目的接口说明")
@RestController
@RequestMapping("/my")
public class myController {
    @GetMapping("/hello")
    public String Hello(){
        System.out.println("进入hello的方法");
        return "返回后端数据";
    }

    @GetMapping("/getU")
    @ApiImplicitParams(value = {@ApiImplicitParam(name = "username", value = "姓名", example = "admin", dataTypeClass = String.class),
            @ApiImplicitParam(name = "age", value = "年龄", example = "16",dataTypeClass = Integer.class)})

    public String GetUser(String username,Integer age) {
        System.out.println("用户名称"+username);
        System.out.println("年龄:"+age);
        return "获取前端数据并返回后端数据";
    }
}

